<?php

namespace pam\Form;

/**
 * Description of IndicatorFieldset
 *
 * @author robert.bwana
 */
use Zend\Form\Fieldset;
use pam\Model\Indicator;
use Zend\Stdlib\Hydrator\ClassMethods;

class IndicatorFieldset extends Fieldset{
    
    public function __construct($name = null, $options = array()) {
        parent::__construct($name, $options);
        
        $this->setHydrator(new ClassMethods(FALSE));
        $this->setObject(new Indicator());
        
        $this->add(array(
            'type' => 'hidden',
            'name' => 'id'
        ));
        
        $this->add(array(
            'type' => 'hidden',
            'name' => 'policy_id'
        ));
        
        $this->add(array(
            'type' => 'text',
            'name' => 'indicator_name',
            'options' => array(
                'label' => 'Indicator name',
            )
        ));
        
        $this->add(array(
            'type' => 'text',
            'name' => 'base_value',
            'options' => array(
                'label' => 'Indicator Base Value'
            )
        ));

        $this->add(array(
            'type' => 'text',
            'name' => 'change_value',
            'options' => array(
                'label' => 'Indicator Change Value'
            )
        ));
        
        $this->add(array(
            'type' => 'Zend\Form\Element\DateSelect',
            'name' => 'value_date',
            'options' => array(
                'label' => 'Date of Value'
            )
        ));
        
        $this->add(array(
            'type' => 'Zend\Form\Element\Radio',
            'name' => 'is_triggered',
            'options' => array(
                'label' => 'Trigger change in policy?',
                'value_options' => array(
                    '1' => 'Yes',
                    '0' => 'No',
                )
            )
        ));
    }

}
